filesystem: add Windows implementation#6072
filesystem: add Windows implementation#6072mattklein123 merged 13 commits intoenvoyproxy:masterfrom greenhouse-org:filesystem-part-3
Conversation
Adds Windows implementation of Filesystem::Instance and Filesystem::File interfaces. Inject the platform-specific implementations of Filesystem::Instance& through MainCommon. Moves IoError class from Network namespace to Api namespace. Signed-off-by: Yael Harel <yharel@pivotal.io> Signed-off-by: Arjun Sreedharan <asreedharan@pivotal.io> Signed-off-by: Sam Smith <sesmith177@gmail.com>
|
I have some context on this and will make some comments :) |
|
Thanks, context much appreciated. I am also wondering if it makes sense to split out the mechanical refactoring moves (I see there are a few in the diff) from the logic changes and new stuff? It may make this much easier to review. |
|
+1 for separate PRs for refactors vs new code. Please split this in two. |
include/envoy/api/io_error.h
Outdated
| // frequent memory allocation of IoError instance. | ||
| // If this is used, IoCallResult has to be instantiated with a deleter that does not | ||
| // deallocate memory for this error. | ||
| #define ENVOY_ERROR_AGAIN reinterpret_cast<Api::IoError*>(0x01) |
There was a problem hiding this comment.
This might be changed in #6037 to address an memory alignment error.
There was a problem hiding this comment.
Oh good :) Can I suggest addressing this with a singleton? I'm generally against singletons but this seems like a good place to use one.
I'll comment also in #6037 .
Signed-off-by: Yael Harel <yharel@pivotal.io> Signed-off-by: Sam Smith <sesmith177@gmail.com>
Signed-off-by: Yael Harel <yharel@pivotal.io> Signed-off-by: Sam Smith <sesmith177@gmail.com>
|
/retest |
|
🔨 rebuilding |
Signed-off-by: Sam Smith <sesmith177@gmail.com> Signed-off-by: Yael Harel <yharel@pivotal.io>
dnoe
left a comment
There was a problem hiding this comment.
I still need to look at the test but flushing comments now to unblock you. Thanks!
| throw EnvoyException(fmt::format("Invalid path: {}", path)); | ||
| } | ||
|
|
||
| std::ios::sync_with_stdio(false); |
There was a problem hiding this comment.
Does this change some global state?
There was a problem hiding this comment.
This was copied from the existing Linux implementation:
There was a problem hiding this comment.
Looks like this has been there for a long long time! I'm actually not sure what it's meant to be doing here, since the documentation implies it only affects the standard streams like stdin, stdout, and stderr. But nothing in this function seems to be dealing with these streams.
@mattklein123 do you remember why this was added?
There was a problem hiding this comment.
No clue. Can we remove this in a follow up on both sides?
Signed-off-by: Yael Harel <yharel@pivotal.io> Signed-off-by: Sam Smith <sesmith177@gmail.com>
Signed-off-by: Yechiel Kalmenson <ykalmenson@pivotal.io> Signed-off-by: Yael Harel <yharel@pivotal.io>
|
Let me know whenever this is ready for another pass and I will take a look. Thanks! |
|
Hi @dnoe, I think that we're ready for another review. Thanks! |
Signed-off-by: Yael Harel <yharel@pivotal.io> Signed-off-by: Natalie Arellano <narellano@pivotal.io>
Signed-off-by: Natalie Arellano <narellano@pivotal.io> Signed-off-by: Yael Harel <yharel@pivotal.io>
|
/retest |
|
🔨 rebuilding |
Envoy::Filesystem::InstanceImpl was splitted to Envoy::Filesystem::InstanceImplWin32 and Envoy::Filesystem::InstanceImplPosix Signed-off-by: Yael Harel <yharel@pivotal.io> Signed-off-by: Natalie Arellano <narellano@pivotal.io>
Signed-off-by: Natalie Arellano <narellano@pivotal.io> Signed-off-by: Yael Harel <yharel@pivotal.io>
|
Hi @dnoe, did you have a chance to review this PR again? |
|
Hey @alyssawilk @dnoe any thoughts on getting this merged? This is blocking the next track of work for Windows support. Thanks! |
|
I think this one is jmarantz@ and dpn@? I'll ping them internally - sorry for the lag. |
dnoe
left a comment
There was a problem hiding this comment.
LGTM - Thanks for making these changes.
mattklein123
left a comment
There was a problem hiding this comment.
LGTM with 2 small comments. Sorry for the delay.
/wait
include/envoy/api/io_error.h
Outdated
| InProgress, | ||
| // Permission denied. | ||
| Permission, | ||
| // Bad handle |
There was a problem hiding this comment.
This was covered in a different @danzh2010 PR, but can we remove this? This should never happen and should be covered with ASSERT/RELEASE_ASSERT if necessary depending on the situation..
| throw EnvoyException(fmt::format("Invalid path: {}", path)); | ||
| } | ||
|
|
||
| std::ios::sync_with_stdio(false); |
There was a problem hiding this comment.
No clue. Can we remove this in a follow up on both sides?
|
🙀 Error while processing event: |
Signed-off-by: Yael Harel <yharel@pivotal.io> Signed-off-by: Yechiel Kalmenson <ykalmenson@pivotal.io>
Description:
Adds Windows implementation of Filesystem::Instance and Filesystem::File interfaces.
Inject the platform-specific implementations of Filesystem::Instance& through MainCommon.
Moves IoError class from Network namespace to Api namespace.
This is step 3/3 in adding Windows filesystem support as outlined here: #5470 (comment).
Risk Level:
Low
Testing:
bazel build //source/... && bazel test //test/...
Docs Changes:
N/A
Release Notes:
N/A
Relates to issue #129
cc: @achasveachas
cc: @sesmith177